
import GameCtrl from "./GameCtrl";
import GameView from "./GameView/GameView";

const {ccclass, property} = cc._decorator;

@ccclass
export default class GameScene extends cc.Component {
    @property(cc.Prefab) gameViewPrafab:cc.Prefab =null;


    private m_GameView:GameView = null;
    private m_GameCtrl:GameCtrl = null;

    start () {
        this.m_GameView = cc.instantiate(this.gameViewPrafab).getComponent(GameView);
        this.node.addChild(this.m_GameView.node);
        this.m_GameCtrl = new GameCtrl();
        this.m_GameCtrl.Init(this.m_GameView);
        this.m_GameCtrl.Play();
    }

    // update (dt) {}
    onDestroy(){
        this.m_GameCtrl.Exit();
    }
}
